package saint.UI.map;

import com.google.android.maps.*;
import android.graphics.*;

public class LocationOverlay extends Overlay {
	private GeoPoint mGeoPoint;
	private Paint locationPaint;
	private Point locationPoint;
	//private Path arrowPath;
	private Bitmap arrow;
	
	//============ Class Constructor ========================================//
	
	public LocationOverlay(GeoPoint geoPoint, Bitmap image) {
		this.mGeoPoint = geoPoint;
		//locationPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
		locationPoint = new Point(0,0);
		//arrowPath = new Path();
		arrow = image;
		
/*		locationPaint.setStyle(Paint.Style.STROKE);
		locationPaint.setStrokeWidth(2);
		locationPaint.setColor(Color.BLUE);*/
		
		
		
	}
	
	//============ Public Method ============================================//
	
	//============ Override Method ==========================================//
	@Override
	public void draw(Canvas canvas, MapView mapView, boolean shadow) {
		super.draw(canvas, mapView, shadow);
		mapView.getProjection().toPixels(mGeoPoint, locationPoint);
		//Make Arrow Path
		//arrowPath.moveTo(locationPoint.x, locationPoint.y);
		int imgW = arrow.getWidth();
		int imgH = arrow.getHeight();
		canvas.drawBitmap(arrow, 
				locationPoint.x - (imgW / 2), 
				locationPoint.y - (imgH / 2), 
				null);
		
		
	}
	
}
